/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykht.proj.coupon.entity.FxCmsInfo;
import com.ykht.proj.coupon.entity.FxWaiterExt;
import com.ykht.proj.coupon.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * cms资讯表
 *
 * @author proj code generator
 * @date 2021-02-01 16:22:52
 */
@Mapper
public interface FxCmsInfoMapper extends BaseMapper<FxCmsInfo> {

	IPage<FxCmsInfoVO> selectValueByPage(IPage<FxCmsInfo> iPage, @Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	FxCmsInfoVO findById(Long id);

	void delById(Long id);

	Integer stickCount(@Param("value") Integer value,@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	Integer infomationTypeCount(@Param("value") Integer value,@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	Integer statusCount(@Param("value") Integer value,@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	Integer allCount(@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	Integer textDraftCoun(@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	Integer videoDraftCount(@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	Integer draftCount(@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

    IPage<FxCmsInfoVO> getBrandInformation(@Param("page") Page page,@Param("fxCmsInfoVO") FxCmsInfoVO fxCmsInfoVO);

	List<FxCmsInfoVO> getTopBook(@Param("current") Long current, @Param("size") Long size, @Param("brandId") Long brandId,@Param("id")  Long id);

	List<FxCmsInfoVO> getBottomBook(@Param("current") Long current, @Param("size") Long size, @Param("brandId") Long brandId);

	FxCmsInfo queryById(FxCmsInfo fxCmsInfo);

	void updateReadCount(FxCmsInfo fxCmsInfo);

    List<FxCmsInfo> selectAll();

	List<FxCmsInfoVO> queryAllCmsInfo(FxWaiterExt waiterExt);

	List<FxCmsInfoVO> queryUnfinished(List<Integer> unfinished,@Param("data") FxWaiterExt waiterExt);

	List<FxCmsInfoVO> queryFinished(List<Integer> unfinished,@Param("data") FxWaiterExt waiterExt);

	Integer queryForward(Long articleId);

	/**
	 * @param id  cmsid
	 * @param forwardTime 转发次数
	 * @param shareTimes c端普通转发次数
	 * @param upTimes 点赞次数
	 * @param commentTimes 评论次数
	 * @param barrageTimes 弹幕个数
	 */
    Integer updateStatisticsByCmsId(@Param("id")Long id, @Param("forwardTime")Integer forwardTime, @Param("shareTimes")Integer shareTimes,@Param("upTimes") Integer upTimes, @Param("commentTimes")Integer commentTimes, @Param("barrageTimes")Integer barrageTimes);

	Page<CmsTemplateCover> homeCmsCover(Page page, @Param("req") CmsTemplateCoverReq req);

	/**
	 * 根据品牌ID查询 品牌时讯
	 * @param page
	 * @param fxCmsInfoVO
	 * @return
	 */
	IPage<FxCmsInfoVO> getBrandCmsPage(Page page, @Param("req") FxCmsInfoVO fxCmsInfoVO);

	/**
	 * S-01首页（文章搜索（精选内容））
	 *
	 * @param page        分页
	 * @param homePageSearch 条件
	 * @return
	 */
	IPage<FxCmsInfoVO> getCmsRecommendPage(Page page, @Param("req") HomePageSearch homePageSearch);
	/**
	 * 根据品牌切换视频
	 *
	 * @param page        分页
	 * @param fxCmsInfoVO 条件
	 * @return
	 */
	IPage<FxCmsInfoVO> getBrandSwitchVideoPage(Page page, @Param("req") FxCmsInfoVO fxCmsInfoVO);

	/**
	 * 根据首页切换视频
	 *
	 * @param page        分页
	 * @param fxCmsInfoVO 条件
	 * @return
	 */
	IPage<FxCmsInfoVO> getHomeSwitchVideoPage(Page page, @Param("req") FxCmsInfoVO fxCmsInfoVO);

	Page<PushCms4C> pushCmsPage(Page<PushCms4C> page, BaseLonLat lonLat);
}
